package com.kfm.jdbc.day0406;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class Client {

    public static void main(String[] args) {
        try {
            Socket client = new Socket("10.0.3.198", 8888);

            OutputStream outputStream = client.getOutputStream();
            outputStream.write("Hello, Server".getBytes());

            outputStream.flush();


            InputStream inputStream = client.getInputStream();
            byte[] bytes= inputStream.readAllBytes();

            System.out.println(new String(bytes));

            client.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
